import { get, post, put} from "./http"



//用户userinfo
export const Userinfo = data => get('https://test.365msmk.com/api/app/userInfo',data)

export const banner = data => get("https://test.365msmk.com/api/app/banner", data)                  //首页
export const index = data => get("https://test.365msmk.com/api/app/recommend/appIndex", data)       //首页
export const course = data => get("https://test.365msmk.com/api/app/courseBasis", data)       //首页
export const getClassify = data => get("https://test.365msmk.com/api/app/courseClassify", data)       //首页


export const homeTabVisibleChange = data => get("https://test.365msmk.com/api/app/courseClassify", data)       //联习
export const Login = p => post(`https://test.365msmk.com/api/app/login`, p);
export const webOauths = p => post(`https://test.365msmk.com/api/app/webOauths`, p);

export const SmsVerification = p => post(`https://test.365msmk.com/api/app/smsCode`, p);  //获取验证码

export const VerificationLogin = p => post(`https://test.365msmk.com/api/app/login`, p);  //登录

export const password = p => post(`https://test.365msmk.com/api/app/password`, p);  //密码设置


export const setinfo = p => put(`https://test.365msmk.com/api/app/password`, p);  //我的信息

export const attr = p => get(`https://test.365msmk.com/api/app/module/attribute/1`, p);  //验证码登录
export const user = p => put(`https://test.365msmk.com/api/app/user`, p);  //我的信息
export const avatar = p => post(`https://test.365msmk.com/api/app/public/img`, p);



export const City = p => get(`https://test.365msmk.com/api/app/sonArea/${p}`);



export const oto = p => get(`https://test.365msmk.com/api/app/otoCourse`, p);
export const otoconditon = p => get(`https://test.365msmk.com/api/app/otoCourseOptions`, p);
export const mystaus = p => get(`https://test.365msmk.com/api/app/myStudy/${p}`, p);
export const list = p => get(`https://test.365msmk.com/api/app/courseInfo/basis_id=${p.id}`, p);

export const teacherId = p => get(`https://test.365msmk.com/api/app/teacher/${p}`, p);
export const teacherInfo = p => get(`https://test.365msmk.com/api/app/teacher/info/${p}`, p);
export const teacherCollect = p => get(`https://test.365msmk.com/api/app/teacher/collect/${p}`, p);

export const coinRank = p => get(`https://test.365msmk.com/api/app/coin/coinRank`, p);

export const item = p => get(`https://test.365msmk.com/api/app/coin/item`, p);
export const wxUrl = p => get(`https://test.365msmk.com/api/app/pay/wxUrl`, p);
export const schedule = p => get(`https://test.365msmk.com/api/app/study/schedule/${p}`, p);

export const downOrder = p => post(`https://test.365msmk.com/api/app/order/downOrder`, p);

export const grade = p => get(`https://test.365msmk.com/api/app/vip/grade`, p);

export const feedback = p => post(`https://test.365msmk.com/api/app/feedback`, p);  //输入框

export const examPoint = p => get(`https://test.365msmk.com/api/app/examPoint/${p.a}/${p.b}`, p);


export const classify = p => get(`https://test.365msmk.com/api/app/wap/classify`, p);
export const quesBank = p => get(`https://test.365msmk.com/api/app/wap/quesBank/${p}`);
export const bank = p => get(`https://test.365msmk.com/api/app/wap/search/bank`,p);
export const sysCourseList = p => post(`https://test.365msmk.com/api/app/sysCourseList`, p);
export const courseChapter = p => post(`https://test.365msmk.com/api/app/courseChapter`, p);
export const cancel = p => put(`https://test.365msmk.com/api/app/collect/cancel/${p}/1`);
export const joinStudy = p => post(`https://test.365msmk.com/api/app/joinStudy`, p);
export const chapterInfo = p => get(`https://test.365msmk.com/api/app/chapterInfo/${p}`, p);
export const video = p => get(`https://test.365msmk.com/api/app/getPlayToken/video_id=${p.video_id}/course_id=${p.id}`, p);
export const course_id = p => get(`https://test.365msmk.com/api/app/getPcRoomCode/course_id=${p.detail}/chapter_id=${p.id}`, p);
export const chapterDatum = p => get(`https://test.365msmk.com/api/app/getPcRoomCode/course_id=${p.datum}/chapter_id=${p.id}`, p);
export const userGetCoupon = p => get(`https://test.365msmk.com/api/app/userGetCoupon/${p}`, p);


// userGetCoupon/${this.couponList[index].id}
// chapterDatum/${file.datum_id}/${file.id}
// detail:this.detail.id,
//                 id:it.id
// /api/app/getPcRoomCode/course_id=${this.detail.id}/chapter_id=${it.id}
// getPlayToken/video_id=${it.video_id}/course_id=${this.detail.id}`
// chapterInfo/${it.id}
// joinStudy
// /api/app/collect/cancel/${this.detail.collect_id}/1
// collect
// courseChapter

// wap/search/bank
// wap/quesBank
// wap/classify
// examPoint
// feedback
// vip/grade
// order/downOrder

// /checkout/studyCard
// export const oto = (obj,data) => Request.getData({                                    
//     url: `https://test.365msmk.com/api/app/otoCourse`,
//     method: "get",
// })
///pay/wxUrl

// /api/app/coin/coinRank
// coinBalance
// /api/app/coinBalance
// export const list1 =  (obj,data) => Request.getData({
//     url: `https://test.365msmk.com/api/app/teacher/info=${obj.id}`,
//     method: "get",
//     data
// })
export const search = obj => get(`https://test.365msmk.com/api/app/courseBasis?limit=${obj.limit}&page=${obj.page}&course_type=${obj.course_type}&keywords=${obj.keywords}`, obj);

export const UserCenter = p => get(`https://test.365msmk.com/api/app/getUCenterInfo`,p);
export const share = p => post(`https://test.365msmk.com/api/app/public/share`, p)

// user, avatar, City

// export const share = (obj,data) => Request.getData({                                    
//     url: `https://test.365msmk.com/api/app/public/share`,
//     method: "post",
// })
// export const UserCenter = (obj,data) => Request.getData({                                    
//     url: `https://test.365msmk.com/api/app/getUCenterInfo`,
//     method: "get",
// })




// export const search = (obj,data) => Request.getData({
//     url: `https://test.365msmk.com/api/app/courseBasis?limit=${obj.limit}&page=${obj.page}&course_type=${obj.course_type}&keywords=${obj.keywords}`,    //特色课--搜索
//     method: "get",
//     data
// })
// export const list =  data => Request.getData({
//     url: `https://test.365msmk.com/api/app/courseInfo/basis_id=${data.id}`,    //特色课
//     method: "get",
//     data
// })
// export const mystaus = (obj,data) => Request.getData({                                    
//     url: `https://test.365msmk.com/api/app/myStudy/`,
//     method: "get",
// })

// export const otoconditon = (obj,data) => Request.getData({                                    
//     url: `https://test.365msmk.com/api/app/otoCourseOptions`,
//     method: "get",
// })
// export const oto = (obj,data) => Request.getData({                                    
//     url: `https://test.365msmk.com/api/app/otoCourse`,
//     method: "get",
// })

// https://test.365msmk.com/api/app/smsCode

//export const getClassify =  data => Request.getData({
    //     url: `https://test.365msmk.com/api/app/courseClassify`,    //分类
    //     method: "get",
    //     data
    // })
// export const course = (obj,data) => Request.getData({
//     url: `https://test.365msmk.com/api/app/courseBasis?page=${obj.page}&limit=${obj.limit}&course_type=${obj.course_type}&classify_id=${obj.classify_id}&order_by=${obj.order_by}&attr_val_id=${obj.attr_val_id}&is_vip=${obj.is_vip}`,    //特色课
//     method: "get",
//     data
// })
// export const banner =  data => Request.getData({
//     url: `https://test.365msmk.com/api/app/banner`,
//     method: "get",
//     data
// })
//首页
// export const index = data => get("https://test.365msmk.com/api/app/recommend/appIndex", data)
// //推荐课程 进入详情页
// export const list=(p)=>get(`https://test.365msmk.com/api/app/courseInfo/basis_id=${p.id}`,p)

// export const list1=(p)=>get(`https://test.365msmk.com/api/app/teacher/info=${p.id}`,p)


// //课程
// export const course =data=>get("https://test.365msmk.com/api/app/courseBasis?page=7&limit=10",data)




// //首页
// export const List = p => get('api/app/recommend/appIndex', p);
// // 详情页
// export const detail = p => get(`api/app/courseInfo/basis_id=${p}`, p);
// // 课程页
// export const classify = p => get(`api/app/courseBasis?page=${p}&limit=10`, p);

// export const page = p => get(`api/app/courseClassify`, p);
// // 搜索
// export const search = p => get(`api/app/courseBasis?page=${p.page}&limit=${p.limit}&course_type=${p.course_type}&keywords=${p.keywords}`, p);

// // 登录接口
// export const Login = p => post(`/api/app/login`, p);
// // 验证码接口
// export const yanMA = p => post(`/api/app/smsCode`, p);
// // 修改密码接口
// export const Pass = p => post(`/api/app/password`, p);